Telegram Group & Telegram Channel
🕕 Задача по Java: Что будет выведено?


public class Main {
public static void main(String[] args) {
Integer a = 127;
Integer b = 127;
Integer c = 128;
Integer d = 128;

System.out.println(a == b); // ?
System.out.println(c == d); // ?
}
}


Варианты:
A) true, true
B) true, false
C) false, true
D) false, false

Правильный ответ: B

Объяснение:
Java кэширует объекты Integer в диапазоне -128 ... 127.
a == b — то же значение и тот же объект.
c == d — разные объекты вне кэша. Используй .equals() для сравнения!



tg-me.com/java_quizes/217
Create:
Last Update:

🕕 Задача по Java: Что будет выведено?


public class Main {
public static void main(String[] args) {
Integer a = 127;
Integer b = 127;
Integer c = 128;
Integer d = 128;

System.out.println(a == b); // ?
System.out.println(c == d); // ?
}
}


Варианты:
A) true, true
B) true, false
C) false, true
D) false, false

Правильный ответ: B

Объяснение:
Java кэширует объекты Integer в диапазоне -128 ... 127.
a == b — то же значение и тот же объект.
c == d — разные объекты вне кэша. Используй .equals() для сравнения!

BY Java tests


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/java_quizes/217

View MORE
Open in Telegram


Java tests Telegram | DID YOU KNOW?

Date: |

At a time when the Indian stock market is peaking and has rallied immensely compared to global markets, there are companies that have not performed in the last 10 years. These are definitely a minor portion of the market considering there are hundreds of stocks that have turned multibagger since 2020. What went wrong with these stocks? Reasons vary from corporate governance, sectoral weakness, company specific and so on. But the more important question is, are these stocks worth buying?

What is Telegram?

Telegram’s stand out feature is its encryption scheme that keeps messages and media secure in transit. The scheme is known as MTProto and is based on 256-bit AES encryption, RSA encryption, and Diffie-Hellman key exchange. The result of this complicated and technical-sounding jargon? A messaging service that claims to keep your data safe.Why do we say claims? When dealing with security, you always want to leave room for scrutiny, and a few cryptography experts have criticized the system. Overall, any level of encryption is better than none, but a level of discretion should always be observed with any online connected system, even Telegram.

Java tests from de


Telegram Java tests
FROM USA